<?php

	function is_class($sType) {

		return class_exists($sType, FALSE);
	}

	function is_abstract($sType) {

		$objReflector = new ReflectionClass($sType);
		return $objReflector -> isAbstract();
	}

	function is_interface($sType) {

		return interface_exists($sType, FALSE);
	}

	function is_built_in($sType) {

		$objReflector = new ReflectionClass($sType);
		return $objReflector -> isInternal();
	}

	function getParsedDocComment($objSubject) {

		$sComment = $objSubject -> getDocComment();
		$sComment = str_replace("\r\n", "\n", $sComment);

		$arrLines = explode("\n", $sComment);
		$sComment = '';
		foreach ($arrLines as $sLine) {

			$sComment .= preg_replace('~(^\s*/\*\*|^\s*\*\*?/|^\s*\*)~', '', $sLine);
			$sComment .= '<br />';
		}

		return $sComment;
	}

	function parseDefaultValue($mValue) {

		ob_start();
		var_export($mValue);
		$mValue = ob_get_clean();

		// some special-character replacements
		$mValue = str_replace("\n", '\\n', $mValue);
		$mValue = str_replace("\r", '\\r', $mValue);
		$mValue = str_replace("\t", '\\t', $mValue);

		return $mValue;
	}

?>